package
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.text.StyleSheet;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	public class Cookbook extends Sprite
	{
		private		var		_urlLoader:URLLoader = null;
		public function Cookbook()
		{
			_urlLoader = new URLLoader();
			var urlReq:URLRequest = new URLRequest("./test.css");
			this._urlLoader.load(urlReq);
			this._urlLoader.addEventListener(Event.COMPLETE, onLoadComplete);
			
			
		}
		
		public	function	onLoadComplete(evt:Event):void{
			var css:StyleSheet = new StyleSheet();
			var str:String = this._urlLoader.data as String
			css.parseCSS(str);
			
			var text:TextField = new TextField();
			this.addChild(text);
			
			text.wordWrap = true;
			text.border = true;
			text.autoSize = TextFieldAutoSize.LEFT;
			text.styleSheet = css;
			text.htmlText = "<p class='sample'>sfasdfsdsfsdf,ssfsd;sdfsdfj</p>";
			

			
		}
	}
}